from tools.Initialization import DEEPFOS_HOST
import os
from tools.ReadJson import read_json
from tools.Request_General import BaseAPI



class PlatformServer(BaseAPI):
    def upload_content(self, pay):
        """
        以内容方式上传文件
        """
        r = self.request_send(json=pay)
        return r

    def file_upload(self, file, par):
        """
        文件上传接口
        """
        r = self.request_send(files=file, params=par)
        return r

    def download_for_system(self, par):
        """
        文件下载接口-文件信息来源:system
        """
        r = self.request_send(params=par)
        return r

    def file_download(self, par):
        """
        文件下载接口
        """
        r = self.request_send(params=par)
        return r

    def file_delete(self, pay):
        """
        文件下载接口
        """
        r = self.request_send(json=pay)
        return r

    def python_upload(self, par, file):
        """
        python文件上传更新接口
        """
        r = self.request_send(params=par, files=file)
        return r

    def python_read(self, pay):
        """
        python文件读取内容接口
        """
        r = self.request_send(json=pay)
        return r

    def python_delete(self, pay):
        """
        python文件删除接口
        """
        r = self.request_send(json=pay)
        return r

    def js_upload(self, pay):
        """
        自定义js文件上传接口
        """
        r = self.request_send(json=pay)
        return r
